package com.chezhujie.www.enums;

import com.chezhujie.www.core.init.mysql.annotation.Enum;

/**
 * 奖品类型表
 * Created by 汤伟杰 on 2017/7/10.
 */
@Enum(name="awardtype" ,type = "select")
public enum AwardType {
    //1活动优惠劵,2商品优惠券,3实物商品,4红包,5活动优惠名额,6谢谢参与
    ACTIVITYCOUPONS("活动优惠劵",1),COMMODITYCOUPONS("商品优惠券",2),PHYSICAL("实物商品",3),REDPACKET("红包",4)
    ,PLACES("活动优惠名额",5),THANKS("谢谢参与",6)
    ;
    private String name;
    private int index;
    // 构造方法
    private AwardType(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (AwardType c : AwardType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }



}
